function add_book(){
    var data = {
        bookid:$("#bookid").val(),
        barcode:$("#barcode").val(),
        bookname:$("#bookname").val(),
        typeid:$("#typeid").val(),
        author:$("#author").val(),
        authorcomtroy:$("#authorcomtroy").val(),
        translator:$("#translator").val(),
        ISBN:$("#ISBN").val(),
        price:$("#price").val(),
        bookcase:$("#bookcase").val(),
        bookpage:$("#bookpage").val(),
        bookcotent:0
    }
    if( data.bookid == "" ||data.barcode == "" ||data.bookname == "" ||data.typeid == "" ||
        data.author == "" ||data.authorcomtroy == "" ||data.translator == "" ||data.ISBN == "" ||
        data.price == "" ||data.bookcase == "" ||data.bookpage == "" ){
        alert("信息没有填写完全")
        return
    }
    var url = "/register/add_book_info"
    var success = function(data){
        alert("ok")
    }
    var error = function(){

    }
    post_ajax(url,data,success,error)

}


function add_user_info(){
    var data = {
        readerid:$("#readerid").val(),
        name:$("#name").val(),
        sex:$("#sex").val(),
        barcode:$("#barcode").val(),
        Type:$("#Type").val(),
        peperNO:$("#peperNO").val(),
        Tel:$("#Tel").val(),
        Email:$("#Email").val(),
        Documents_state:$("#Documents_state").val(),
        remark:0
    }
    if( data.readerid == "" ||data.name == "" ||data.sex == "" ||data.barcode == "" ||
        data.Type == "" ||data.peperNO == "" ||data.Tel == "" ||data.Email == "" ||
        data.Documents_state == "" ||data.remark == ""){
        alert("信息没有填写完全")
        return
    }

    console.log(data)
    var url = "/register/add_user_info"
    var success = function(data){
        alert("ok")
    }
    var error = function(){

    }
    post_ajax(url,data,success,error)

}

function add_publish_info(){
    var data = {
        ISBN:$("#ISBN").val(),
        pubname:$("#pubname").val(),
        pubaddr:$("#pubaddr").val(),
        Zip_code:$("#Zip_code").val(),
        first_pubtel:$("#first_pubtel").val(),
        second_pubtel:$("#second_pubtel").val(),
        pubperson:$("#pubperson").val(),
    }
    console.log(data)
    if( data.ISBN == "" ||data.pubname == "" ||data.pubaddr == "" ||data.Zip_code == "" ||
        data.first_pubtel == "" ||data.Tel == "" ||data.second_pubtel == "" || data.pubperson == ""){
        alert("信息没有填写完全")
        return
    }

    console.log(data)
    var url = "/register/add_publish_info"
    var success = function(data){
        alert("ok")
    }
    var error = function(){

    }
    post_ajax(url,data,success,error)

}

function add_book_type(){
    var data = {
        booktypeid:$("#booktypeid").val(),
        Typename:$("#Typename").val(),
        Type_outline:$("#Type_outline").val(),
    }
    console.log(data)
    if( data.booktypeid == "" ||data.Typename == "" ||data.Type_outline == "" ){
        alert("信息没有填写完全")
        return
    }
    console.log(data)
    var url = "/register/add_book_type_info"
    var success = function(data){
        alert("ok")
    }
    var error = function(){

    }
    post_ajax(url,data,success,error)

}